import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useCounterStore = defineStore('counter', () => {
    const token=ref("")
    const setToken=(val)=>(token.value=val)

    const planeAreaName1=ref()
    const setPlaneAreaName1=(val)=>(planeAreaName1.value=val)
    const planeAreaName2=ref()
    const setPlaneAreaName2=(val)=>(planeAreaName2.value=val)
    const planeDate =ref()
    const setPlaneDate=(val)=>{planeDate.value=val}

    //酒店起始时间
    const pubStartTime=ref()
    const setPubStartTime=(val)=>(pubStartTime.value=val)

    //酒店结束时间
    const pubEndTime=ref()
    const setPubEndTime=(val)=>(pubEndTime.value=val)

    const userForm=ref()//用户表单
    const setUserForm=(val)=>(userForm.value=val) //设置用户表单

    const tz=ref(1)//跳转
    const addTz=()=>{
        console.log("tz+1")
        tz.value++
    }//增加跳转



    return {token,setToken,planeDate,planeAreaName1,planeAreaName2,setPlaneDate,setPlaneAreaName1,setPlaneAreaName2,setUserForm,userForm,tz,addTz,
        pubStartTime,setPubStartTime,pubEndTime,setPubEndTime}
},{
    persist: true // 持久化
})